﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Wicture.QPZS.EPC.API.Domain.Entities;

namespace Wicture.QPZS.EPC.API.Domain
{
    public class ServiceHandlerSelector : IServiceHandlerSelector
    {
        public THandler Select<THandler>(IEnumerable<THandler> handlers, ThrottlingContext context) where THandler : IServiceHandler
        {
            return handlers.FirstOrDefault(s => s.ServiceName.EqualsIgnoreCase(context.ApiName));
        }
    }
}
